package com.edmendst.xmall.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import javax.validation.constraints.PositiveOrZero;

@Data
public class ProductCategory {
    //分类信息
    @JsonProperty("categoryId")
    private Integer categoryId;
    @JsonProperty("categoryName")
    private String categoryName;
    @PositiveOrZero(message = "父分类ID必须为0或正整数")
    @JsonProperty("parentId")
    private Integer parentId;

    public ProductCategory( String categoryName, Integer parentId) {

        this.categoryName = categoryName;
        this.parentId = parentId;
    }

    public ProductCategory() {
    }
}
